home *** CD-ROM | disk | FTP | other *** search
/ World Book 1996 / The World Book Multimedia Encyclopedia v3.20b.iso / wb.ms_ / wb.ms
Text File  |  1996-02-23  |  17KB  |  563 lines

  1. '**************************************************************************
  2. '*                       Illustrated Info Finder 1995
  3. '**************************************************************************
  4.  
  5. '$DEFINE DEBUG  ''Define for script development/debugging
  6.  
  7. '$INCLUDE 'setupapi.inc' 
  8. '$INCLUDE 'mscpydis.inc'    ''System
  9. '$INCLUDE 'msdetect.inc'    ''Detects Available Disk Space
  10.  
  11. ''Dialog ID's
  12. CONST ASKQUIT      = 200
  13. CONST DESTPATH     = 300 
  14. CONST VFWDESTPATH  = 301
  15. CONST EXITFAILURE  = 400 
  16. CONST WINRESTART   = 450
  17. CONST EXITQUIT     = 600
  18. CONST EXITSUCCESS  = 700
  19. CONST OPTIONS      = 800
  20. CONST APPHELP      = 900
  21. CONST CUSTINST     = 6200
  22. CONST TOOBIG       = 6300
  23. CONST BADPATH      = 6400
  24.  
  25. ''Bitmap ID
  26. CONST LOGO         = 1
  27.  
  28. ''File Types
  29. CONST APPFILES     = 1
  30. CONST OPTFILES1    = 2 
  31.  
  32.  
  33. GLOBAL DEST$        ''Default destination directory for IIF.
  34. GLOBAL DEST2$        ''Default destination directory for VfW.
  35. GLOBAL WINDRIVE$    ''Windows drive letter.
  36. GLOBAL OPT1OPT$     ''Option selection from OptFiles1 option dialog.
  37. GLOBAL WinDir$ 
  38. GLOBAL WinSysDir$ 
  39.  
  40.  
  41. ''CustInst list symbol names
  42. GLOBAL APPNEEDS$    ''Option list costs per drive
  43. GLOBAL OPT1NEEDS$ 
  44. GLOBAL EXTRACOSTS$  ''List of extra costs to add per drive
  45. GLOBAL BIGLIST$     ''List of option files cost calc results (boolean)
  46.  
  47. ''Dialog list symbol names
  48. GLOBAL CHECKSTATES$
  49. GLOBAL STATUSTEXT$
  50. GLOBAL DRIVETEXT$ 
  51. GLOBAL DRIVETEXT2$
  52.  
  53.  
  54. DECLARE SUB AddOptFilesToCopyList (ftype%)
  55. DECLARE SUB RecalcOptFiles (ftype%)
  56. DECLARE SUB RecalcPath
  57. DECLARE SUB SetDriveStatus
  58. DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
  59. DECLARE FUNCTION VflatdPresent LIB "iniupd.DLL" AS INTEGER
  60.  
  61.  
  62. INIT:
  63.     CUIDLL$ = "mscuistf.dll"            ''custom user interface dll
  64.     HELPPROC$ = "FHelpDlgProc"          ''Help dialog procedure
  65.  
  66.     SetBitmap CUIDLL$, LOGO
  67.     SetTitle "The World Book Multimedia Encyclopedia"
  68.  
  69.     szInf$ = GetSymbolValue("STF_SRCINFPATH")
  70.     IF szInf$ = "" THEN
  71.         szInf$ = GetSymbolValue("STF_CWDDIR") + "WB.INF"
  72.     END IF
  73.       
  74.     ReadInfFile szInf$
  75.     WinDir$ = GetWindowsDir() 
  76.     WinSysDir$ = WinDir$ + "System"
  77.         
  78.     WINDRIVE$ = MID$(GetWindowsDir, 1, 1)
  79.     DEST$ = WINDRIVE$ + ":\WBME"
  80.     DEST2$ = WINDRIVE$ + ":\VfW"                             
  81.  
  82.     ''CustInst list symbols
  83.     CHECKSTATES$ = "CheckItemsState"
  84.     STATUSTEXT$  = "StatusItemsText"
  85.     DRIVETEXT$   = "DriveStatusText"
  86.     FOR i% = 1 TO 1 STEP 1
  87.         AddListItem CHECKSTATES$, "ON"
  88.     NEXT i%  
  89.     FOR i% = 2 TO 2 STEP 1
  90.         AddListItem CHECKSTATES$, "OFF"
  91.     NEXT i%
  92.     FOR i% = 1 TO 2 STEP 1
  93.         AddListItem STATUSTEXT$, ""
  94.     NEXT i%
  95.     FOR i% = 1 TO 7 STEP 1
  96.         AddListItem DRIVETEXT$, ""
  97.     NEXT i%
  98.     ReplaceListItem DRIVETEXT$, 7, DEST$
  99.  
  100.     ''Disk cost list symbols
  101.     APPNEEDS$   = "AppNeeds"
  102.     OPT1NEEDS$  = "Opt1Needs" 
  103.     OPT2NEEDS$  = "Opt2Needs"
  104.     EXTRACOSTS$ = "ExtraCosts"
  105.     BIGLIST$    = "BigList"
  106.     FOR i% = 1 TO 2 STEP 1
  107.         AddListItem BIGLIST$, ""
  108.     NEXT i%
  109.     FOR i% = 1 TO 26 STEP 1
  110.         AddListItem EXTRACOSTS$, "0"
  111.     NEXT i%
  112.  
  113.     ''File Option Variables
  114.     OPT1OPT$ = "1" 
  115.  
  116.     RecalcPath
  117.     SetDriveStatus
  118.  
  119. '$IFDEF DEBUG
  120.     i% = SetSizeCheckMode(scmOnIgnore)    '' could use scmOff; def = scmOnFatal
  121. '$ENDIF ''DEBUG
  122.  
  123.  
  124.  
  125. CUSTINST:
  126.     sz$ = UIStartDlg(CUIDLL$, CUSTINST, "FCustInstDlgProc", APPHELP, HELPPROC$)
  127.  
  128.     IF sz$ = "CONTINUE" THEN
  129.         ''Install only if it will fit.
  130.         FOR i% = 1 TO 2 STEP 1
  131.             IF GetListItem(BIGLIST$, i%) <> "" THEN
  132.                 GOSUB TOOBIG
  133.                 GOTO CUSTINST
  134.             END IF
  135.         NEXT i%
  136.         UIPop 1
  137.         GOTO INSTALL
  138.     ELSEIF sz$ = "PATH" THEN
  139.         GOTO GETPATH
  140.     ELSEIF sz$ = "CHK1" THEN
  141.         RecalcOptFiles APPFILES
  142.         SetDriveStatus
  143.         GOTO CUSTINST  
  144.     ELSEIF sz$ = "CHK2" THEN
  145.         RecalcOptFiles OPTFILES1
  146.         SetDriveStatus
  147.         GOTO CUSTINST 
  148.     ELSEIF sz$ = "BTN2" THEN
  149.         GOTO OPTFILES1 
  150.     ELSEIF sz$ = "REACTIVATE" THEN
  151.         RecalcPath
  152.         SetDriveStatus
  153.         GOTO CUSTINST
  154.     ELSE
  155.         GOSUB ASKQUIT
  156.         GOTO CUSTINST
  157.     END IF
  158.  
  159.  
  160.  
  161. INSTALL:  
  162.  
  163.     IF GetListItem(CHECKSTATES$, APPFILES) = "ON" THEN
  164.         CreateDir DEST$, cmoNone        
  165.         ClearCopyList 
  166.         SrcDir$ = GetSymbolValue("STF_SRCDIR")
  167.         AddOptFilesToCopyList APPFILES
  168.         AddSectionFilesToCopyList "xvt", SrcDir$, WinSysDir$
  169.         CopyFilesInCopyList
  170.         CreateProgmanGroup "WB Multimedia", "", cmoNone
  171.         ShowProgmanGroup  "WB Multimedia", 1, cmoNone
  172.         CreateProgmanItem "WB Multimedia", "World Book", MakePath(DEST$,"iifwin.exe"), "", cmoOverwrite
  173.         CreateProgmanItem "WB Multimedia", "readme.txt", "notepad.exe "+MakePath(DEST$,"readme.txt"), "", cmoOverwrite
  174.      END IF 
  175.     
  176.     IF GetListItem(CHECKSTATES$, OPTFILES1) = "ON" THEN
  177.     CreateDir DEST2$, cmoNone
  178.     ClearCopyList
  179.     SrcDir$ = GetSymbolValue("STF_SRCDIR")
  180.     ReadInfFile szInf$
  181.      
  182. ''  Runtime files
  183.     AddSectionFilesToCopyList "vfw", SrcDir$, WinSysDir$
  184.     AddSectionFilesToCopyList "ole2", SrcDir$, WinSysDir$
  185.     AddSectionFilesToCopyList "acm", SrcDir$, WinSysDir$
  186.     AddSectionFilesToCopyList "mplayer", SrcDir$, WinDir$
  187.     AddSectionFilesToCopyList "avicodecs", SrcDir$, WinSysDir$
  188.     AddSectionFilesToCopyList "indeo-ini", SrcDir$, WinDir$
  189.  
  190.         
  191.         CopyFilesInCopyList
  192.     ''Updating WIN.INI and SYSTEM.INI
  193.         IF VflatdPresent() = 0 THEN
  194.                CreateSysIniKeyValue WinDir$ + "system.ini", "386Enh", "device", "dva.386", cmoOverwrite
  195.         END IF
  196.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.CVID", "iccvid.drv", cmoOverwrite
  197.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.MSVC", "msvidc.drv", cmoOverwrite
  198.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.IV31", "indeov.drv", cmoOverwrite
  199.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.MRLE", "MSRLE.drv", cmoOverwrite
  200.     I% = DoesIniKeyExist (WinDir$ + "system.ini", "Drivers", "VIDC.RT21")
  201.         IF I% = 0  THEN
  202.                CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.RT21", "indeov.drv", cmoOverwrite
  203.         END IF
  204.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.YVU9", "indeov.drv", cmoOverwrite
  205.     CreateIniKeyValue WinDir$ + "WIN.INI", "mci extensions", "avi", "AVIVideo", cmoOverwrite
  206.     CreateIniKeyValue WinDir$ + "system.ini", "mci", "AVIVideo", "mciavi.drv", cmoOverwrite
  207.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "WaveMapper", "msacm.drv", cmoOverwrite
  208.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "MSACM.msadpcm", "msadpcm.acm", cmoOverwrite
  209.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "MSACM.imaadpcm", "imaadpcm.acm", cmoOverwrite
  210.     CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "msacm.drv", "Microsoft Sound Mapper V2.00", cmoOverwrite
  211.     CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "msadpcm.acm", "Microsoft ADPCM Codec V2.00", cmoOverwrite
  212.     CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "imaadpcm.acm", "Microsoft IMA ADPCM Codec V2.00", cmoOverwrite
  213.     ''Run ("regedit.exe /s " + MakePath(WinDir$, "mplayer.reg"))
  214.     Run ("regedit.exe /s " + MakePath(WinSysDir$, "OLE2.reg"))
  215.     Run ("regedit.exe /s " + MakePath(WinSysDir$, "cleanup.reg"))
  216.  
  217.     '' Mplayer
  218.     CreateProgmanItem "VfW", "Media Player", MakePath(WinDir$, "mplayer.exe"), "", cmoOverwrite
  219.  
  220.     ''Run ("profdisp.exe")
  221.     END IF
  222.  
  223.      
  224. SYSSTUFF:
  225.     I% = RestartListEmpty()
  226.     sz$ = UIStartDlg(CUIDLL$,WINRESTART, "FInfo0DlgProc", 0, "")
  227.     IF sz$ = "CONTINUE" THEN
  228.         UIPop 1
  229.         GOTO CLOSEWIN
  230.     ''ELSE
  231.         ''GOTO QUIT
  232.     END IF
  233.  
  234.  
  235. CLOSEWIN:                        
  236.     SetRestartDir WinDir$
  237.     Exe$ = DEST$ + "\_msrstrt.exe"
  238.     Batch$ = DEST$ + "\_mssetup.bat"
  239.     empty$ = ""
  240.     I% = ExitExecRestart ()
  241.     RemoveFile Exe$, cmoForce
  242.     RemoveFile Batch$, cmoForce
  243.     END
  244.  
  245.  
  246. QUIT:
  247.     ON ERROR GOTO ERRQUIT
  248.  
  249.     IF ERR = 0 THEN
  250.         dlg% = EXITSUCCESS
  251.     ELSEIF ERR = STFQUIT THEN
  252.         dlg% = EXITQUIT
  253.     ELSE
  254.         dlg% = EXITFAILURE
  255.     END IF
  256. QUITL1:
  257.     sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
  258.     IF sz$ = "REACTIVATE" THEN
  259.         GOTO QUITL1
  260.     END IF
  261.     UIPop 1
  262.  
  263.     END
  264.  
  265. ERRQUIT:
  266.     i% = DoMsgBox("Setup sources were corrupted, call 555-1212!", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  267.     END
  268.  
  269.  
  270.  
  271. GETPATH:
  272.     SetSymbolValue "EditTextIn", DEST$
  273.     SetSymbolValue "EditFocus", "END"
  274. GETPATHL1:
  275.     sz$ = UIStartDlg(CUIDLL$, DESTPATH, "FEditDlgProc", APPHELP, HELPPROC$)
  276.  
  277.     IF sz$ = "CONTINUE" THEN
  278.         olddest$ = DEST$
  279.         DEST$ = GetSymbolValue("EditTextOut")
  280.  
  281.         ''Validate new path.
  282.         IF IsDirWritable(DEST$) = 0 THEN
  283.             GOSUB BADPATH
  284.             GOTO GETPATHL1
  285.         END IF
  286.         UIPop 1
  287.  
  288.         ''Truncate display if too long.
  289.         IF LEN(DEST$) > 23 THEN
  290.             ReplaceListItem DRIVETEXT$, 7, MID$(DEST$, 1, 23)+"..."
  291.         ELSE
  292.             ReplaceListItem DRIVETEXT$, 7, DEST$
  293.         END IF
  294.  
  295.         ''Recalc if path changed.
  296.         IF (olddest$ <> DEST$) AND (olddest$ <> DEST$+"\") AND (olddest$+"\" <> DEST$) THEN
  297.             RecalcPath
  298.             SetDriveStatus
  299.         END IF
  300.  
  301.         olddest$ = ""
  302.         GOTO CUSTINST
  303.     ELSEIF sz$ = "REACTIVATE" THEN
  304.         RecalcPath
  305.         SetDriveStatus
  306.         GOTO GETPATHL1
  307.     ELSEIF sz$ = "EXIT" THEN
  308.         GOSUB ASKQUIT
  309.         GOTO GETPATHL1
  310.     ELSE
  311.         UIPop 1
  312.         GOTO CUSTINST
  313.     END IF
  314.  
  315.  
  316.  
  317. OPTFILES1: 
  318.     SetSymbolValue "EditTextIn", DEST2$
  319.     SetSymbolValue "EditFocus", "END"
  320. OPT1L1:
  321.     sz$ = UIStartDlg(CUIDLL$, VFWDESTPATH, "FEditDlgProc", APPHELP, HELPPROC$)
  322.  
  323.     IF sz$ = "CONTINUE" THEN
  324.         olddest$ = DEST2$
  325.         DEST2$ = GetSymbolValue("EditTextOut")
  326.  
  327.         ''Validate new path.
  328.         IF IsDirWritable(DEST2$) = 0 THEN
  329.             GOSUB BADPATH
  330.             GOTO OPT1L1
  331.         END IF
  332.         UIPop 1
  333.  
  334.         ''Truncate display if too long.
  335.         IF LEN(DEST2$) > 23 THEN
  336.             ReplaceListItem DRIVETEXT2$, 7, MID$(DEST2$, 1, 23)+"..."
  337.         ELSE
  338.             ReplaceListItem DRIVETEXT2$, 7, DEST2$
  339.         END IF
  340.  
  341.         ''Recalc if path changed.
  342.         IF (olddest$ <> DEST2$) AND (olddest$ <> DEST2$+"\") AND (olddest$+"\" <> DEST2$) THEN
  343.             RecalcPath
  344.             SetDriveStatus
  345.         END IF
  346.  
  347.         olddest$ = ""
  348.         GOTO CUSTINST
  349.     ELSEIF sz$ = "REACTIVATE" THEN
  350.         RecalcPath
  351.         SetDriveStatus
  352.         GOTO OPT1L1
  353.     ELSEIF sz$ = "EXIT" THEN
  354.         GOSUB ASKQUIT
  355.         GOTO OPT1L1
  356.     ELSE
  357.         UIPop 1
  358.         GOTO CUSTINST
  359.     END IF
  360.     
  361.  
  362.  
  363. TOOBIG:
  364.     sz$ = UIStartDlg(CUIDLL$, TOOBIG, "FInfo0DlgProc", 0, "")
  365.     IF sz$ = "REACTIVATE" THEN
  366.         RecalcPath
  367.         SetDriveStatus
  368.         GOTO TOOBIG
  369.     END IF
  370.     UIPop 1
  371.     RETURN
  372.  
  373.  
  374.  
  375. BADPATH:
  376.     sz$ = UIStartDlg(CUIDLL$, BADPATH, "FInfo0DlgProc", 0, "")
  377.     IF sz$ = "REACTIVATE" THEN
  378.         RecalcPath
  379.         SetDriveStatus
  380.         GOTO BADPATH
  381.     END IF
  382.     UIPop 1
  383.     RETURN
  384.  
  385.  
  386.  
  387. ASKQUIT:
  388.     sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
  389.  
  390.     IF sz$ = "EXIT" THEN
  391.         UIPopAll
  392.         ERROR STFQUIT
  393.     ELSEIF sz$ = "REACTIVATE" THEN
  394.         GOTO ASKQUIT
  395.     ELSE
  396.         UIPop 1
  397.     END IF
  398.     RETURN
  399.  
  400.  
  401.  
  402. '**
  403. '** Purpose:
  404. '**     Adds the specified option files to the copy list.
  405. '** Arguments:
  406. '**     ftype%  - type of files to add, one of the following:
  407. '**             APPFILES, OPTFILES1
  408. '** Returns:
  409. '**     none.
  410. '*************************************************************************
  411. SUB AddOptFilesToCopyList (ftype%) STATIC
  412.  
  413.     IF GetListItem(CHECKSTATES$, ftype%) = "ON" THEN
  414.         SrcDir$ = GetSymbolValue("STF_SRCDIR") 
  415.         ''szInf$ = GetSymbolValue("STF_SRCINFPATH")
  416.         ''ReadInfFile szInf$
  417.         IF ftype% = APPFILES THEN
  418.             AddSectionFilesToCopyList "wb", SrcDir$, DEST$
  419.         ELSEIF ftype% = OPTFILES1 THEN
  420.             AddSectionFilesToCopyList "vfw", SrcDir$, WinSysDir$
  421.             AddSectionFilesToCopyList "ole2", SrcDir$, WinSysDir$
  422.             AddSectionFilesToCopyList "acm", SrcDir$, WinSysDir$
  423.             AddSectionFilesToCopyList "mplayer", SrcDir$, WinDir$
  424.             AddSectionFilesToCopyList "avicodecs", SrcDir$, WinSysDir$
  425.             AddSectionFilesToCopyList "indeo-ini", SrcDir$, WinDir$
  426.         END IF
  427.         SrcDir$ = ""
  428.     END IF
  429. END SUB
  430.  
  431.  
  432. '**
  433. '** Purpose:
  434. '**     Recalculates disk space for the given option files and sets
  435. '**     the status info symbol "StatusItemsText".
  436. '** Arguments:
  437. '**     ftype% - type of files to add, one of the following:
  438. '**             APPFILES, OPTFILES1
  439. '** Returns:
  440. '**     none.
  441. '*************************************************************************
  442. SUB RecalcOptFiles (ftype%) STATIC
  443.     CursorSave% = ShowWaitCursor()
  444.     ClearCopyList
  445.     AddOptFilesToCopyList ftype%
  446.  
  447.     fExtra% = 0
  448.     IF ftype% = APPFILES THEN
  449.         ListSym$ = APPNEEDS$
  450.         IF GetListItem(CHECKSTATES$, APPFILES) = "ON" THEN
  451.             ''Add extra cost to Windows drive for ini/progman, etc.
  452.             ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
  453.             ReplaceListItem EXTRACOSTS$, ndrive%, "10240"
  454.             fExtra% = 1
  455.         END IF
  456.     ELSEIF ftype% = OPTFILES1 THEN
  457.         ListSym$ = OPT1NEEDS$
  458.     END IF
  459.  
  460.     StillNeed& = GetCopyListCost(EXTRACOSTS$, ListSym$, "")
  461.  
  462.     cost& = 0
  463.     FOR i% = 1 TO 26 STEP 1
  464.         cost&  = cost& + VAL(GetListItem(ListSym$, i%))
  465.     NEXT i%
  466.     ReplaceListItem STATUSTEXT$, ftype%, STR$(cost& / 1024) + " K"
  467.  
  468.     IF StillNeed& > 0 THEN
  469.         ReplaceListItem BIGLIST$, ftype%, "YES"
  470.     ELSE
  471.         ReplaceListItem BIGLIST$, ftype%, ""
  472.     END IF
  473.  
  474.     IF fExtra% THEN
  475.         ReplaceListItem EXTRACOSTS$, ndrive%, "0"
  476.     END IF
  477.     RestoreCursor CursorSave%
  478.     ListSym$ = ""
  479. END SUB
  480.  
  481.  
  482. '**
  483. '** Purpose:
  484. '**     Recalculates disk space and sets option status info according
  485. '**     to the current destination path.
  486. '** Arguments:
  487. '**     none.
  488. '** Returns:
  489. '**     none.
  490. '*************************************************************************
  491. SUB RecalcPath STATIC
  492.  
  493.     CursorSave% = ShowWaitCursor()
  494.  
  495.     RecalcOptFiles APPFILES
  496.     RecalcOptFiles OPTFILES1
  497.  
  498.     RestoreCursor CursorSave%
  499. END SUB
  500.  
  501.  
  502. '**
  503. '** Purpose:
  504. '**     Sets drive status info according to latest disk space calcs.
  505. '** Arguments:
  506. '**     none.
  507. '** Returns:
  508. '**     none.
  509. '*************************************************************************
  510. SUB SetDriveStatus STATIC
  511.  
  512.     drive$ = MID$(DEST$, 1, 1)
  513.     ndrive% = ASC(ucase$(drive$)) - ASC("A") + 1
  514.     cost& = VAL(GetListItem(APPNEEDS$, ndrive%)) + VAL(GetListItem(OPT1NEEDS$, ndrive%)) 
  515.     free& = GetFreeSpaceForDrive(drive$)
  516.     ReplaceListItem DRIVETEXT$, 1, drive$ + ":"
  517.     ReplaceListItem DRIVETEXT$, 2, STR$(cost& / 1024) + " K"
  518.     ReplaceListItem DRIVETEXT$, 3, STR$(free& / 1024) + " K"
  519.  
  520.     IF drive$ = WINDRIVE$ THEN
  521.         ReplaceListItem DRIVETEXT$, 4, ""
  522.         ReplaceListItem DRIVETEXT$, 5, ""
  523.         ReplaceListItem DRIVETEXT$, 6, ""
  524.     ELSE
  525.         ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
  526.         cost& = VAL(GetListItem(APPNEEDS$, ndrive%)) + VAL(GetListItem(OPT1NEEDS$, ndrive%)) 
  527.         IF cost& = 0 THEN
  528.             ReplaceListItem DRIVETEXT$, 4, ""
  529.             ReplaceListItem DRIVETEXT$, 5, ""
  530.             ReplaceListItem DRIVETEXT$, 6, ""
  531.         ELSE
  532.             free& = GetFreeSpaceForDrive(WINDRIVE$)
  533.             ReplaceListItem DRIVETEXT$, 4, WINDRIVE$ + ":"
  534.             ReplaceListItem DRIVETEXT$, 5, STR$(cost& / 1024) + " K"
  535.             ReplaceListItem DRIVETEXT$, 6, STR$(free& / 1024) + " K"
  536.         END IF
  537.     END IF
  538. END SUB
  539.  
  540.  
  541. '**
  542. '** Purpose:
  543. '**     Appends a file name to the end of a directory path,
  544. '**     inserting a backslash character as needed.
  545. '** Arguments:
  546. '**     szDir$  - full directory path (with optional ending "\")
  547. '**     szFile$ - filename to append to directory
  548. '** Returns:
  549. '**     Resulting fully qualified path name.
  550. '*************************************************************************
  551. FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
  552.     IF szDir$ = "" THEN
  553.         MakePath = szFile$
  554.     ELSEIF szFile$ = "" THEN
  555.         MakePath = szDir$
  556.     ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  557.         MakePath = szDir$ + szFile$
  558.     ELSE
  559.         MakePath = szDir$ + "\" + szFile$
  560.     END IF
  561. END FUNCTION
  562.  
  563.